package prc;

import java.net.URI;
import java.util.Date;

public class User {
	
	enum UserRank{
		addict, average, noobie,
		god, //admin
		semi_god //moderator
	}
	
	enum UserGroup{
		admin,user,moderator
	}
	
	private String username;
	private String password;
	private String firstname="";
	private String lastname="";
	private boolean isVisible;
	private Date lastVisitDate;
	private int age;	
	private UserGroup group;
    private Date regDate;
    private UserRank rank;
    private int nrMsg;
    private String statusMsg="";
    private String country="";
    private String location="";
    
    
	public User(String username,String password, String firstname,String lastname,int age){
		this.username=username;
		this.password=password;
		this.firstname=firstname;
		this.lastname=lastname;
		this.regDate=new Date();
		this.rank=UserRank.noobie;
		this.group=UserGroup.user;
		this.age=age;
		nrMsg=0;
	}
    
    
    
	public String getGroup() {
		return group.toString();
	}

	public void setGroup(UserGroup group) {
		this.group = group;
	}

	public String getRank() {
		return rank.toString();
	}

	public void setRank(UserRank rank) {
		this.rank = rank;
	}

	public int getNrMsg() {
		return nrMsg;
	}

	public void setNrMsg(int nrMsg) {
		this.nrMsg = nrMsg;
	}

	public String getStatusMsg() {
		return statusMsg;
	}

	public void setStatusMsg(String statusMsg) {
		this.statusMsg = statusMsg;
	}

	public String getCountry() {
		return country;
	}

	public void setCountry(String country) {
		this.country = country;
	}

	public String getLocation() {
		return location;
	}

	public void setLocation(String location) {
		this.location = location;
	}

	public Date getRegDate() {
		return regDate;
	}

	public Date getLastVisitDate() {
		return lastVisitDate;
	}

	public void setLastVisitDate(Date lastVisitDate) {
		this.lastVisitDate = lastVisitDate;
	}


	public void incrementNrMsg(){
		nrMsg++;
		if(nrMsg>10&&nrMsg<20)
			rank=User.UserRank.average;
		else if(nrMsg>20)
			rank=User.UserRank.addict;
	}

	
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getFirstname() {
		return firstname;
	}
	public void setFirstname(String firstname) {
		this.firstname = firstname;
	}
	public String getLastname() {
		return lastname;
	}
	public void setLastname(String lastname) {
		this.lastname = lastname;
	}
	public int getAge() {
		return age;
	}
	public void setAge(int age) {
		this.age = age;
	}

	public boolean isVisible() {
		return isVisible;
	}

	public void setVisible(boolean isVisible) {
		this.isVisible = isVisible;
	}

}
